/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import dao.EvenementDAO;
import entity.Evenement;
import java.util.List;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import org.jboss.weld.context.ejb.Ejb;

/**
 *
 * @author linos
 */
@ManagedBean(name="eventBean")
@SessionScoped
public class EventBean {
        
    @Ejb
    private EvenementDAO evenementDAO=new EvenementDAO();
    private Evenement evenement;
    private List<Evenement> evenements;
    
    
    public EventBean() {
    }

    public EvenementDAO getEvenementDAO() {
        return evenementDAO;
    }

    public void setEvenementDAO(EvenementDAO evenementDAO) {
        this.evenementDAO = evenementDAO;
    }

    public Evenement getEvenement() {
        return evenement;
    }

    public void setEvenement(Evenement evenement) {
        this.evenement = evenement;
    }

    public List<Evenement> getEvenements() {
            System.out.println("evenementDAO.findAll();"+evenementDAO.findAll().size());
        return evenementDAO.findAll();
    }

    public void setEvenements(List<Evenement> evenements) {
        this.evenements = evenements;
    }
    
    
}
